package com.etd.base.domain;

/**
 * 返回前端执行结果标志
 * @author jacksonWang
 *
 */
public class RetDomain {

	//执行成功标志,success:成功,error:失败
	private String status;
	
	//提示信息
	private String msg;
	
	//返回的实体对象
	private Object rows;
	
	//返回的实体数量
	private Long total;
	
	public RetDomain(){}
	
	
	public static RetDomain errorDomain(String msg){
		RetDomain domain= new RetDomain();
		domain.status = "error";
		domain.msg = msg;
		return domain;
	}
	
	public static RetDomain successDomain(String msg){
		RetDomain domain= new RetDomain();
		domain.status = "success";
		domain.msg = msg;
		return domain;
	}


	public String getStatus() {
		return status;
	}

	//设置操作失败信息
	public void setErrorMsg(String errorMsg){
		this.status = "error";
		this.msg = errorMsg;
		
	}
	
	//设置成功信息
	public void setSuccessMsg(String sucMsg){
		this.status = "success";
		this.msg = sucMsg;
		
	}
	public void setStatus(String status) {
		this.status = status;
	}


	public String getMsg() {
		return msg;
	}


	public void setMsg(String msg) {
		this.msg = msg;
	}


	public Object getRows() {
		return rows;
	}


	public void setRows(Object rows) {
		this.rows = rows;
	}


	public Long getTotal() {
		return total;
	}


	public void setTotal(Long total) {
		this.total = total;
	}
	
	
	
}
